<?php
session_start();

// 检查是否已完成安装
if (!isset($_SESSION['install_complete']) || !$_SESSION['install_complete']) {
    header('Location: index.php');
    exit;
}

// 清理安装会话
$installData = $_SESSION;
session_destroy();
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考勤管理系统 - 安装完成</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
        }
        .install-container {
            background: white;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            overflow: hidden;
        }
        .install-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 2rem;
            text-align: center;
        }
        .install-body {
            padding: 2rem;
        }
        .step-indicator {
            display: flex;
            justify-content: space-between;
            margin-bottom: 2rem;
            position: relative;
        }
        .step-indicator::before {
            content: '';
            position: absolute;
            top: 20px;
            left: 0;
            right: 0;
            height: 2px;
            background: #e9ecef;
            z-index: 1;
        }
        .step {
            text-align: center;
            position: relative;
            z-index: 2;
        }
        .step-number {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #e9ecef;
            color: #6c757d;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 0.5rem;
            font-weight: bold;
        }
        .step.active .step-number {
            background: #667eea;
            color: white;
        }
        .step.completed .step-number {
            background: #28a745;
            color: white;
        }
        .step-label {
            font-size: 0.875rem;
            color: #6c757d;
        }
        .step.active .step-label {
            color: #667eea;
            font-weight: bold;
        }
        .success-icon {
            font-size: 4rem;
            color: #28a745;
            margin-bottom: 1rem;
        }
        .next-steps {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 1.5rem;
            margin: 2rem 0;
        }
        .next-step {
            display: flex;
            align-items: center;
            margin-bottom: 1rem;
            padding: 0.5rem;
        }
        .next-step:last-child {
            margin-bottom: 0;
        }
        .next-step i {
            width: 30px;
            text-align: center;
            margin-right: 1rem;
            color: #667eea;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-8 col-lg-6">
                <div class="install-container">
                    <div class="install-header">
                        <h1><i class="fas fa-clock me-2"></i>考勤管理系统</h1>
                        <p class="mb-0">安装向导</p>
                    </div>
                    
                    <div class="install-body">
                        <!-- 步骤指示器 -->
                        <div class="step-indicator">
                            <div class="step completed">
                                <div class="step-number"><i class="fas fa-check"></i></div>
                                <div class="step-label">环境检测</div>
                            </div>
                            <div class="step completed">
                                <div class="step-number"><i class="fas fa-check"></i></div>
                                <div class="step-label">数据库配置</div>
                            </div>
                            <div class="step completed">
                                <div class="step-number"><i class="fas fa-check"></i></div>
                                <div class="step-label">系统安装</div>
                            </div>
                            <div class="step active">
                                <div class="step-number">4</div>
                                <div class="step-label">完成安装</div>
                            </div>
                        </div>

                        <div class="text-center">
                            <div class="success-icon">
                                <i class="fas fa-check-circle"></i>
                            </div>
                            <h3 class="text-success mb-3">安装完成！</h3>
                            <p class="lead">考勤管理系统已成功安装并配置完成。</p>
                        </div>

                        <div class="next-steps">
                            <h5 class="mb-3"><i class="fas fa-list-check me-2"></i>后续步骤</h5>
                            
                            <div class="next-step">
                                <i class="fas fa-user-shield"></i>
                                <div>
                                    <strong>安全提醒</strong>
                                    <p class="mb-0 text-muted">请立即登录系统并修改默认管理员密码</p>
                                </div>
                            </div>
                            
                            <div class="next-step">
                                <i class="fas fa-trash-alt"></i>
                                <div>
                                    <strong>清理安装文件</strong>
                                    <p class="mb-0 text-muted">建议删除 install 目录以确保系统安全</p>
                                </div>
                            </div>
                            
                            <div class="next-step">
                                <i class="fas fa-cog"></i>
                                <div>
                                    <strong>系统配置</strong>
                                    <p class="mb-0 text-muted">登录后配置工作时间、部门等系统参数</p>
                                </div>
                            </div>
                        </div>

                        <div class="alert alert-warning">
                            <h6><i class="fas fa-exclamation-triangle me-2"></i>重要安全提醒</h6>
                            <p class="mb-2">为了系统安全，请务必：</p>
                            <ul class="mb-0">
                                <li>修改默认管理员密码</li>
                                <li>删除 install 安装目录</li>
                                <li>定期备份数据库</li>
                                <li>保持系统和插件更新</li>
                            </ul>
                        </div>

                        <div class="alert alert-info">
                            <h6><i class="fas fa-info-circle me-2"></i>默认管理员账号</h6>
                            <p class="mb-1"><strong>用户名:</strong> admin</p>
                            <p class="mb-1"><strong>密码:</strong> admin123</p>
                            <p class="mb-0"><small>请妥善保管管理员账号信息</small></p>
                        </div>

                        <div class="d-grid gap-2">
                            <a href="../public/login.php" class="btn btn-success btn-lg">
                                <i class="fas fa-sign-in-alt me-2"></i>立即登录系统
                            </a>
                            <a href="../" class="btn btn-outline-primary">
                                <i class="fas fa-home me-2"></i>返回首页
                            </a>
                        </div>

                        <div class="text-center mt-4">
                            <small class="text-muted">
                                感谢您选择考勤管理系统 v1.0.0<br>
                                如有问题，请查看文档或联系技术支持
                            </small>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
